<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>BOM : window</title>

    <script type="text/javascript">
        // 直接在 script 元素中书写的 JavaScript 代码 属于 全局代码
        console.log( 'Window对象: ' , Window );

        console.log( 'Window.prototype: ' , Window.prototype );

        console.log( 'Window实例: ' , window );

        // 在全局作用域中可以使用 this 来获取 "全局的对象"(global对象)
        console.log( 'this: ' , this );

        console.log( this === window ); // true

        console.log( '- - - - - - - - - - - - - - - -' );

        let names = Object.getOwnPropertyNames( window );
        let fn = function( e ){
            console.log( e );
        }
        names.forEach( fn );

    </script>

</head>
<body>
    
</body>
</html>